<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>

<body>
    <div id="root">
        <h2>欢迎来到{{name}}</h2>
        <input type="text" placeholder="按下回车键输入" @keydown.tab="showInfo">
    </div>
    <script>
        Vue.config.productionTip = false;

        new Vue({
            el: "#root",
            data() {
                return {
                    name: '湖南'
                }
            },
            methods: {
                showInfo(e) {
                    // if (e.keyCode !== 13) return
                    console.log(e.target.value);
                }
            }
        })
    </script>
</body>

</html>